import  time
from timeit import timeit

from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait

driver = webdriver.Chrome(executable_path='Chromedriver.exe')
driver.get("http://121.43.169.97:8848/pageA.html")

# 需求：打开注册A页面，完成以下操作
# 1).使用显式等待定位用户名输入框，如果元素存在，就输入admi


# 实例化webDriverWait，并调用until(method)方法
wait = WebDriverWait(driver,10,1)
username = wait.until(lambda x: x.find_element_by_id("userA"))
username.send_keys("admin")
